package cn.zhangxin.pethome.system.systemdictionarytype.service.impl;

import cn.zhangxin.pethome.base.service.impl.BaseServiceImpl;
import cn.zhangxin.pethome.system.systemdictionarydetail.domain.Systemdictionarydetail;
import cn.zhangxin.pethome.system.systemdictionarytype.domain.Systemdictionarytype;
import cn.zhangxin.pethome.system.systemdictionarytype.mapper.SystemdictionarytypeMapper;
import cn.zhangxin.pethome.system.systemdictionarytype.service.ISystemdictionarytypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemdictionarytypeServiceImpl extends BaseServiceImpl<Systemdictionarytype> implements ISystemdictionarytypeService {
   @Autowired
    private SystemdictionarytypeMapper systemdictionarytypeMapper;

    @Override
    public List<Systemdictionarydetail> findBySystemdictionarydetail(Long id) {
        List<Systemdictionarydetail> detail = systemdictionarytypeMapper.findBySystemdictionarydetail(id);
        if(detail!=null){
            return detail;
        }else {
            throw new RuntimeException("无子类");
        }
    }

    @Override
    public Long findBySystemdictionarydetailCount(Long id) {
        return systemdictionarytypeMapper.findBySystemdictionarydetailCount(id);
    }
}
